<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><s:text name="loginPage" /></title>
</head>
<body>

	<table width="300" align="center">
		<form action="login" method="post">
			<tr>
				<td>用户名:</td>
				<td>
					<input type="text" name="username" />
				</td>
			</tr>
			<tr>
				<td>密&nbsp;码:</td>
				<td>
					<input type="text" name="password" />
				</td>
			</tr>
			<tr>
				<td>
					<input type="submit" value="登录" />
				</td>
				<td>
					<input type="submit" value="注册" onclick="regist();" />
				</td>
			</tr>
		</form>
	</table>
	<script type="text/javascript">
		function regist() {
			//获取页面的第一个表单
			targetForm = document.forms[0];
			//动态修改表单的action属性
			targetForm.action = "regist";
		}
	</script>
</body>
</html>